function myAjax(method,url,data,deal200,deal404,deal500,async){	
	var ajax=getAjax();
	ajax.onreadystatechange=function(){
		if(ajax.readyState==4){
			if(ajax.status==200){
				if(deal200){
					deal200(ajax);
				}
			}else if(ajax.status==404){
				if(deal404){
					deal404();
				}						
			}else if(ajax.status==500){
				if(deal500){
					deal500();
				}
			}
		}
	};
	
		if("get"==method){
			ajax.open("get",url+(data==null?"":"?"+data),async);
			ajax.send(null);
		}else if("post"==method){
			ajax.open("post",url,async);
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			ajax.send(data);
		}
		
}	
/* --------------------------------------------------------------------------- */
function getAjax(){
	var ajax;
	if(window.XMLHttpRequest){
		ajax=new XMLHttpRequest();
	}else if(window.ActiveXObject){
		ajax=new ActiveXObject("Msxml2.XMLHTTP");
	}
	
	return ajax;
}	
